<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script src="../../../js/echarts.min.js" charset="utf-8"></script>
</head>

<body>
    <div id="main" style="width: 600px; height:600px;"></div>
    <script>
        var chartDom = document.getElementById('main');
        var myChart = echarts.init(chartDom);
        var option;
        $.ajax({
            url: "http://localhost:8080/admin/person/resident/queryPersonResidentEchartPie",
            type: "post",
            data: {},
            success: function (result) {
                var arr = result.data.pie;
                option = {
                    title: {
                        text: '居民性别比例图'
                    },
                    legend: {
                        top: 'bottom'
                    },
                    toolbox: {
                        show: true,
                        feature: {
                        mark: { show: true },
                        dataView: { show: true, readOnly: false },
                        restore: { show: true },
                        saveAsImage: { show: true }
                        }
                    },
                    series: [
                        {
                        name: 'Nightingale Chart',
                        type: 'pie',
                        radius: [50, 250],
                        center: ['50%', '50%'],
                        roseType: 'area',
                        itemStyle: {
                            borderRadius: 8
                        },
                        data: arr
                        }
                    ]
                    };

                    myChart.setOption(option);
                }
            })
    </script>
</body>

</html>